package edu.udlap.spring2008.is300.finalexam.app.mvc.model.database.filters;

import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.filters.ImageRecordFilter;
import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.filters.ImageRecordFilterDecorator;
import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.objects.PrivacyLevelRecord;

/**
 *
 * @author Ruslán Ledesma Garza
 */
public class AppImageRecordFilterPrivacyLevel extends ImageRecordFilterDecorator
{   
    public AppImageRecordFilterPrivacyLevel(ImageRecordFilter imageRecordFilter,
            PrivacyLevelRecord privacyLevelRecord, boolean isNegated)
    {
        decoratedImageRecordFilter_ = imageRecordFilter;
        filterValue_ = privacyLevelRecord;
        isNegated_ = isNegated;
    }

    @Override
    protected String getSqlConstraints_()
    {
        return "\"ID_PRIVACY\" " + (isNegated_ ? "!" : "") +
                "= " + ((PrivacyLevelRecord)filterValue_).getId();
    }
}